import { App } from "vue"
import { useUserStore } from "@/store/user"


export const permission = (app: App<Element>) => {
    app.directive('permission', {
        mounted(el, binding) {
            const store = useUserStore()
            if (!store.permission.includes(binding.value)) {
                el.remove()
            }
        },
    })
}
